<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="initial-scale=1, maximum-scale=3, minimum-scale=1, user-scalable=no">
	<meta http-equiv="pragma" content="no-cache"> 
	<meta http-equiv="Cache-Control" content="no-cache, must-revalidate"> 
	<meta http-equiv="expires" content="0">
	<link rel="icon" href="./assets/logo.ico">
	<title>掌上化销APP下载</title>
	<link rel="stylesheet" type="text/css" href="./css/base.css" />
</head>

<body>
	<div id="download">
		<div class="logo-view">
			<img src="./assets/logo.png" alt="logo" class="logo">
		</div>
		<p class="logo-text1">让你的工作变简单</p>
		<p class="logo-text2">— 更高效 更自由 —</p>
		<div class="bg-view">
			<img src="./assets/bgback.jpg" alt="bg" class="bgback">
			<img src="./assets/bg.png" alt="bg" class="bg">
		</div>
		<div class="download-btn" onclick="download()">
			<img src="./assets/btn.png" alt="btn" class="download-btn-bg">
			<p class="download-text">立即下载</p>
		</div>
		<div class="footer">
			<p>中化石化销售有限公司版权所有</p>
			<p>Copyright © <span id="time">2020</span></p>
		</div>

		<div class="weixin-tips" id='tips'>
			<img src="./assets/tiparrow.png" class="weixin-tips-arrow">
			<div class="weixin-tips-view">
				<p class="weixin-tips-text">1. 点击右上角 “ <img src="./assets/link.jpg" class="weixin-tips-link"> ”</p>
				<p class="weixin-tips-text">2. 选择 “在浏览器中打开”</p>
			</div>
		</div>
	</div>
</body>
<script>
	var sUserAgent = navigator.userAgent.toLowerCase();
	var bIsAndroid = sUserAgent.toLowerCase().match(/android/i) == "android";
	var bIsIos = sUserAgent.toLowerCase().match(/iphone/i) == "iphone";
	var bIsWeiXin = sUserAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger";
	var weiXinTips = document.getElementById('tips');

	document.getElementById('time').innerHTML = new Date().getFullYear();

	function download() {
		if (bIsWeiXin) {
			weiXinTips.style.display = 'block';
		} else {
			weiXinTips.style.display = 'none';
			if (bIsAndroid) {
				window.open(`https://uat.sinochemhx.com/download/UbmpApp.apk?time=${new Date().getTime()}`);
			}
			if (bIsIos) {
				window.open(
					'itms-services://?action=download-manifest&url=https://app.sinochem.com/pkg/rls/zshx/install.plist'
				);
			}
		}
	}
</script>

</html>